package com.yh.rbac.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.yh.rbac.dao.RoleMapper;
import com.yh.rbac.entity.Role;
import com.yh.rbac.service.RoleService;

@Service
public class RoleServiceImpl implements RoleService{
	@Resource
	private RoleMapper roleMapper ;
	@Transactional(propagation = Propagation.REQUIRED)
	@Override
	public int deleteByPrimaryKey(Long id) {
		return roleMapper.deleteByPrimaryKey(id) ;
	}

	@Transactional(propagation = Propagation.REQUIRED)
	@Override
	public int insert(Role record) {
		return roleMapper.insert(record) ;
	}

	@Override
	public Role selectByPrimaryKey(Long id) {
		return roleMapper.selectByPrimaryKey(id) ;
	}

	@Override
	public List<Role> selectAll() {
		return roleMapper.selectAll() ;
	}

	@Override
	public int updateByPrimaryKey(Role record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<Role> selectByCondition(String condition , String findType) {
		return roleMapper.selectByCondition(condition , findType);
	}

}
